Skip to content

Conversation

@awendelin-work
Copy link
Contributor

@awendelin-work awendelin-work commented Dec 20, 2024

For the event statistics histogram view, the HistogramDataProvider will occasionally fail with an IndexOutOfBoundsException when its fetchXY method is called before its state-system backed statistics have been populated with attributes.

Add a check to verify that the y-values provided by the statistics is large enough for the x-values.

The stacktrace in question. I occasionally see it when I open traces in vscode using the incubator trace-server.

Caused by: java.lang.IndexOutOfBoundsException: Index: 0
	at java.base/java.util.Collections$EmptyList.get(Collections.java:4483)
	at java.base/java.util.Arrays.setAll(Arrays.java:5414)
	at org.eclipse.tracecompass.internal.tmf.core.histogram.HistogramDataProvider.fetchXY(HistogramDataProvider.java:131)
	at org.eclipse.tracecompass.tmf.core.model.xy.TmfTreeXYCompositeDataProvider.getXyResponses(TmfTreeXYCompositeDataProvider.java:187)
	at org.eclipse.tracecompass.tmf.core.model.xy.TmfTreeXYCompositeDataProvider.fetchXY(TmfTreeXYCompositeDataProvider.java:136)
	at org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.DataProviderService.getXY(DataProviderService.java:417)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80)
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:253)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
	... 30 more

For the event statistics histogram view, the HistogramDataProvider
will occasionally fail with an IndexOutOfBoundsException when its
fetchXY method is called before its state-system backed statistics
have been populated with attributes.

Add a check to verify that the y-values provided by the statistics is
is large enough for the x-values.

Signed-off-by: Adam Wendelin <[email protected]>
@bhufmann bhufmann self-assigned this Jan 6, 2025
Copy link
Contributor

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me. Thanks for reporting and fixing this issue.

Copy link
Contributor

@MatthewKhouzam MatthewKhouzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MatthewKhouzam MatthewKhouzam merged commit a7673d5 into eclipse-tracecompass:master Jan 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants